import request from "@/utils/request";
export const login = (data) => {
  return request({
    url: "login",
    method: "post",
    data,
  });
};
export const menus = (data) => {
  return request({
    url: "menus",
    method: "get",
    data,
  });
};
export const getlist1 = (data) => {
  return request({
    url: "users",
    method: "get",
    params: data,
  });
};
export const getstustas = (id, sta) => {
  return request({
    url: `users/${id}/state/${sta}`,
    method: "put",
  });
};
export const getadd = (data) => {
  return request({
    url: "users",
    method: "post",
    data,
  });
};
export const getxiugai = (id) => {
  return request({
    url: `users/${id}`,
    method: "get",
  });
};
export const getxiugaidiyi = (data) => {
  return request({
    url: `users/${data.id}`,
    method: "put",
    data,
  });
};
export const getshanchu = (id) => {
  return request({
    url: `users/${id}`,
    method: "delete",
    data: null,
  });
};
export const getfenpei = () => {
  return request({
    url: "roles",
    method: "get",
  });
};
export const getfenpeiid = (id, data) => {
  return request({
    url: `users/${id}/role`,
    method: "put",
    data,
  });
};
